<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="__ROOT__/static/admin/css/pintuer.css">
    <link rel="stylesheet" href="__ROOT__/static/admin/css/admin.css">
    <script src="__ROOT__/static/admin/js/jquery.js"></script>
    <script src="__ROOT__/static/admin/js/pintuer.js"></script>
    <script src="__ROOT__/static/plugins/layer/layer.min.js"></script>
</head>
<body>
<div id="listform">
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加活动</a></div>
        <form method="post" action="{:url('admin/Activity/index')}">
            <div class="padding border-bottom">
                <ul class="search" style="padding-left:10px;">
                    <li> <a class="button border-main icon-plus-square-o" href="{:url('admin/Activity/addActivityView')}"> 添加活动内容</a> </li>
                    <li>搜索：</li>
                    <li>
                        <input type="text" placeholder="请输入搜索活动标题" id="active_title" name="active_title" class="input" style="width:250px; line-height:17px;display:inline-block" value="" />
                        <input type="submit" class="button border-main icon-search" value="搜索"/>
                    </li>
                </ul>
            </div>
        </form>
        <table class="table table-hover text-center">
            <tr>
                <th>活动名称</th>
                <th>活动内容</th>
                <th>图片</th>
                <th>参与人数</th>
                <th>活动开始时间</th>
                <th>活动结束时间</th>
                <th width="10%">更新时间</th>
                <th width="200">操作</th>
            </tr>
            {volist name="res" id="vo"}
            <tr>
                <input type="hidden" name="id" id="id" value="{$vo.id}">
                <td>{$vo.active_title}</td>
                <td width="400">{$vo.active_content}</td>
                <td width="10%"><img src="__ROOT__{$vo.active_imgs_url}" alt="" width="70" height="50" /></td>
                <td>{$vo.active_num}</td>
                <td>{:date('Y-m-d H:i:s',$vo.start_time)}</td>
                <td>{:date('Y-m-d H:i:s',$vo.over_time)}</td>
                <td>{:date('Y-m-d H:i:s',$vo.create_time)}</td>
                <td>
                    <div class="button-group">
                        <a class="button border-main" href="{:url('admin/Activity/updateActivityView',array('id'=>$vo['id']))}"><span class="icon-edit"></span> 修改</a>
                        <a class="button border-red" href="javascript:void(0)" onclick="del({$vo.id})"><span class="icon-trash-o"></span> 删除</a>
                    </div>
                </td>
            </tr>
            {/volist}
            <tr>
                <td colspan="8">
                    <div class="pagelist">
                        {$page}
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<script type="text/javascript">
    //单个删除
    function del(id){
        var data = {};
        data.id = id;
        layer.confirm('您确定要删除吗?', {
            btn: ['确定','取消']
        },  function(){
            $.post("{:url('admin/Activity/delActivity')}", data, function (response){
                if(response > 0){
                    layer.msg('删除成功', {icon: 5});
                    window.location.href = "{:url('admin/Activity/index')}";
                }else {
                    layer.msg('删除失败', {icon: 5});
                }

            });
        });

    }



</script>
</body>
</html>